const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('./tang_poems.db');

console.log('查找"古朗月行"的信息...\n');

db.get('SELECT * FROM tang_poems WHERE title = "古朗月行"', (err, row) => {
  if (err) {
    console.error('查询出错:', err);
  } else if (row) {
    console.log('找到诗歌:');
    console.log(`标题: ${row.title}`);
    console.log(`作者: ${row.author}`);
    console.log(`朝代: ${row.dynasty}`);
    console.log(`内容: ${row.content}`);
    console.log(`译文: ${row.translations}`);
    console.log(`赏析: ${row.appreciation}`);
  } else {
    console.log('未找到"古朗月行"');
  }
  
  db.close();
}); 